#include "systrayicon.h"
#include <QAction>
#include <QMenu>

SysTrayIcon::SysTrayIcon(QObject *parent) :
    QSystemTrayIcon(parent)
{
    setToolTip(tr("DICOM Print Station"));
    setIcon(QIcon(":/window.ico"));
    restoreAction = new QAction(tr("Restore"), this);
    quitAction = new QAction(tr("Quit"), this);

    connect(restoreAction, SIGNAL(triggered()), this, SIGNAL(restoreWindow()));
    connect(quitAction, SIGNAL(triggered()), this, SIGNAL(quitApp()));

    contextMenu = new QMenu;
    contextMenu->addAction(restoreAction);
    contextMenu->addAction(quitAction);
    setContextMenu(contextMenu);
}

SysTrayIcon::~SysTrayIcon()
{
    delete contextMenu;
}
